{% extends 'base.html' %}
{% block title %}
<title>登录----博客管理系统</title>
{% endblock %}

{% block css %}
{{block.super}}
<link rel="stylesheet" type="text/css" href="/static/css/login.css">
{% endblock%}

{% block content %}
<div class="container">
    <div class="siteIcon"><img src="/static/images/icon/icon.png" alt="" data-toggle="tooltip" data-placement="top"
                               title="登录博客" draggable="false"/></div>
    <form action="" method="post" autocomplete="off" class="form-signin">
        {% csrf_token %}
        <h2 class="form-signin-heading" style="float:left">用户登录<h2 style="float:right"><a href="{% url 'users:register' %}">前往注册 ></a></h2></h2>
        <label for="userName" class="sr-only">用户名:{{errors.username}}</label>
        <input type="text" id="userName" name="username" class="form-control" placeholder="请输入用户名" required autofocus
               autocomplete="off" maxlength="10">
        <label for="userPwd" class="sr-only">密码:{{errors.userpwd}}</label>
        <input type="password" id="userPwd" name="userpwd" class="form-control" placeholder="请输入密码" required
               autocomplete="off" maxlength="18">

        <button class="btn btn-lg btn-primary btn-block" type="submit" id="signinSubmit">登录</button>

    </form>
</div>
<script src="/static/js/bootstrap.min.js"></script>
<script>
$('[data-toggle="tooltip"]').tooltip();
window.oncontextmenu = function(){
	//return false;
};
$('.siteIcon img').click(function(){
	window.location.reload();
});
$('#signinSubmit').click(function(){
	if($('#userName').val() === ''){
		$(this).text('用户名不能为空');
	}else if($('#userPwd').val() === ''){
		$(this).text('密码不能为空');
	}else{
		$(this).text('请稍后...');
	}
});


</script>
{% endblock %}